package com.zbkj.crmeb.enums;

/**
 * 功能描述: 海带云推单原因列表
 * @Author: wangzh
 * @Date: 2022/11/7 17:10
 */
public enum ReturnReasonEnum {
    //退单原因列表
    OTHER(0, "其他"),
    DUPLICATE_ID_CARD(1, "身份证重复"),
    ECCEPTION_ADDRESS(2, "地址异常：地址中不能出现关于超市、母婴店、药店等类似的字眼"),
    ADDRESS_EXCEEDS_THE_PURCHASE_LIMIT(3, "地址超过购买限额"),
    INCORRECT_CONTACT_INFORMATION(4, "联系方式有误"),
    CUSTOMS_CLEARANCE_FAILURE(5, "报关失败"),
    DUPLICATE_RECIPIENT_INFORMATION(6, "收件人信息重复"),
    DOCUMENT_WAS_NOT_APPROVED(7, "单证审核不通过"),
    ID_CARD_CUSTOMS_SEAL_NUMBER(8, "身份证海关封号"),
    WRONG_ID_CARD_NUMBER(10, "身份证号码错误"),
    ID_NUMBER_NOT_CORRESPOND_NAME(20, "身份证号码与姓名不对应"),
    AUTHENTICATION_FAILURE(30, "身份验证失败"),
    LOCATION_UNKNOWN(40, "地址不详"),
    REPEAT_ADDRESS(50, "地址重复"),
    CONTACT_INFORMATION_EXCEEDS_THE_PURCHASE_LIMIT(60, "联系方式超过购买限额"),
    ID_INFORMATION_EXCEEDS_THE_PURCHASE_LIMIT(70, "身份信息超过购买限额"),
    ORDER_GOODS_OUT_OF_STOCK(80, "订单商品缺货"),
    COULD_NOT_CONTACT_THE_CONSIGNEE(90, "物流配送无法联系到收货人"),
    NO_ID_PHOTO_UPLOAD(100, "推单失败"),
    PLATFORM_DECLARATION_FAILURE(110, "平台报关失败"),
    ORDER_RECEIVING_FAILURE(120, "API接单失败"),
    PAY_FAILURE(130, "盛付通支付失败"),
    ;


    private Integer code;
    private String reason;

    ReturnReasonEnum(Integer code, String reason) {
        this.code = code;
        this.reason = reason;
    }

    public Integer getCode() {
        return code;
    }

    public String getReason() {
        return reason;
    }

    public static ReturnReasonEnum getTypeByCode(Integer code){
        if (code != null){
            for (ReturnReasonEnum value : ReturnReasonEnum.values()){
                if (value.code.equals(code)){
                    return value;
                }
            }
        }
        return null;
    }

}
